

import java.util.ArrayList;

public class Task 
{
	private int id;
	private String name;
	private int period;
	private int deadline;
	private int priority;
	private int bcet;
	private int wcet;
	private int wcrt;
	private double rta;
	private int computationTime;
	private ArrayList<Job> jobs;
	
	public Task(int id)
	{
		this.id = id;
		
		init();
	}
	
		
	private void init()
	{
		this.jobs = new ArrayList<Job>();
	}

	public int getPeriod() {
		return period;
	}

	public void setPeriod(int period) {
		this.period = period;
	}

	public int getBcet() {
		return bcet;
	}

	public void setBcet(int bcet) {
		this.bcet = bcet;
	}

	public int getWcet() {
		return wcet;
	}

	public void setWcet(int wcet) {
		this.wcet = wcet;
	}

	public int getWcrt() {
		return wcrt;
	}

	public void setWcrt(int wcrt) {
		this.wcrt = wcrt;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public ArrayList<Job> getJobs() {
		return jobs;
	}

	public void setJobs(ArrayList<Job> jobs) {
		this.jobs = jobs;
	}
	
	public void addJobs(Job j){
		
		jobs.add(j);
	}
	
	public int getJobsSize(){
		
		return jobs.size();
	}
	
	public String toString()
	{
		return "#" + name + " ID : " + id + " Priority : " + priority + " Period : " + getPeriod() + " WCET : " + getWcet() + " BCET : " + getBcet() + " WCRT : " + getWcrt();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	//According to assumptions for A1 and A2 (project.pdf, p. 2-3) then period=deadline
	public void setDeadline(int deadline) {
		this.deadline = deadline;
	}

	public int getDeadline() {
		return deadline;
	}

	public void setComputationTime(int computationTime) {
		this.computationTime = computationTime;
	}

	public int getComputationTime() {
		return computationTime;
	}

	public int getId() {
		return id;
	}


	public double getRta()
    {
    	return rta;
    }


	public void setRta(double rta)
    {
    	this.rta = rta;
    }
}
